04 Code Filter

What Is It?

If any individual code needs to be displayed only under certain circumstances, the qualification criteria should be specified via the Code Filter property.

An example of a Code Filter in Survey Shaper.

How Do I Use This?

The Code Filter is specified in the same way as the Define Filter property (in the Properties Pane). The individual answer will only be displayed to a survey respondent if the filter criteria are met. If the Code Filter field is left blank, the selected answer will always be displayed to survey respondents.

All filters need to be prefaced by the @ symbol.

Examples of Use

If for example, you wanted to ask the following question:

Q2. Which of the following animals would you MOST like to see at the zoo?

Please select ONE only

  1. Elephant
  2. Lion
  3. Tiger
  4. Sloth
  5. Urangutan
  6. Giraffe
  7. Meerkat
  8. Other
  9. Don't know

You may wish to filter the answer codes so that only those animals that can be seen in a particular zoo are visible to survey respondents. In other words, assuming that in a previous question (S1a), the respondent has indicated that they are intending to visit Melbourne Zoo (S1a=2). As there are no sloths to be found at Melbourne Zoo, we can apply a filter (@S1a=2) to that code to remove it from the list of available options for people intending to visit Melbourne zoo, but it remains visible to those visiting other zoos.

Source Question Type Example Filter
Single @Q4=2 (filter to those who gave an answer of code 2 in Q4)
Multi @Q4_2=1 (filter to those who gave an answer of code 2 in Q4)
Multi @Q4_2=0 Or @Q4_2 is null (filter to those who DIDN'T give an answer of code 2 in Q4)
Single @Q1 = 2 Or @Q4 = 2 (filter to those who gave an answer of code 2 in Q1 OR Q2)
Single

(@Q1 = 2 Or @Q1 = 3) And @Q4 = 2 (filter to those who gave an answer of code 2 OR 3 in Q1 AND code 2 in Q2)

Multi @Q4_Count>1 (filter to those who gave more than one answer in Q4)

See also

Filters